﻿using System.Collections.Generic;
using System.Collections;

namespace FireFly
{
    /// <summary>
    /// Presents hierarchically organized view model
    /// </summary>
    public interface IHierarchicalViewModel : IViewModel
    {
        /// <summary>
        /// Parent of current node
        /// </summary>
        /// <remarks> For view models Parent will be collection which contains it. And for the collection parent will be view model, where the collection is defined.</remarks>
        IHierarchicalViewModel Parent
        {
            get;
            set;
        }

        /// <summary>
        /// Collection of child elements for binding in view. For example, you can bind it to ItemSource of TreeView/TreeViewItem.
        /// </summary>
        ICollection VisualChildren
        {
            get;
        }

        /// <summary>
        /// Removes current node from it's parent
        /// </summary>
        IRelayCommand RemoveCommand
        {
            get;
        }

        /// <summary>
        /// Notify observers, that VisualChildren changed
        /// </summary>
        void RaiseVisualChildrenUpdated();
    }
}
